{
	template:`
	<a-page-header title="编辑" sub-title="管理员信息">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col v-if="link&&link.adminGroup" :span="24">
						<a-form-item label="所属部门" class="index-form-item">
							<span v-if="link.adminGroup.parent&&link.adminGroup.parent.oid" style="padding-right:10px;">{{link.adminGroup.parent.name}}</span>
							<span v-if="link.adminGroup.oid">{{link.adminGroup.name}}</span>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="账号" class="index-form-item">
							<a-input v-model:value="model.username" placeholder="请输入用户名" :disabled="model.oid!=null"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="真实姓名" class="index-form-item">
							<a-input v-model:value="model.realname" placeholder="请输入真实姓名"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="密码" class="index-form-item">
							<a-input-password v-model:value="model.password" placeholder="请输入密码"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="重复密码" class="index-form-item">
							<a-input-password v-model:value="password" placeholder="请再次输入密码"/>
						</a-form-item>
					</a-col>
					<a-col :span="24" style="padding-bottom:18px;">
						<a-alert message="不填写密码则不会修改原密码" type="info" />
					</a-col>
					<a-col :span="12">
						<a-form-item label="管理员组" class="index-form-item">
							<a-select :options="dictOptions('manage.model.AdminGroup:A')" v-model:value="model.adminGroup.oid" placeholder="请选择管理员组" show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="头像" class="index-form-item">
							<a-button type="primary" @click="selectImagePage(model,'headImage','defaultHead')">选择</a-button>
							<img :src="model.headImage.thumPath" class="item-image" @click="viewImage(model.headImage)"/>
						</a-form-item>
					</a-col>
					<!--<a-col :span="24">
						<a-form-item label="管理员组" class="index-form-item">
							<a-button type="primary" @click="selectOneModel(model,'adminGroup','action/manage/adminGroup/selectAdminGroupPage','800px')">选择</a-button>
							{{model.adminGroup.name}}
						</a-form-item>-->
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			model:{adminGroup:{},headImage:{}},
			link:null,
			password:'',
		};
	},
	mounted(){
		this.model=this.param.model;
		this.model.password='';
		this.link=this.param.link;
	},
	methods:{
		save:function(){
			this.requestData('action/manage/adminLogin/doSave',
				{model:this.model,link:this.link,password:this.password},
				data=>{
					if(!data.code){
						this.$message.success(data.msg);
						this.back(true);
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
	}
}